package day10;

// 实体类
public class Student {
	// 属性  属性私有，封装 
	// private修饰的方法和属性只能在当前类中使用
	private int id;
	private String name;
	private int age;
	private String gender;
	public double salary;
	
	// 无参构造方法
	public Student() {
		System.out.println("Student.Student()");
	}
	
	// 有参构造方法
	public Student(int id, String name, int age, String gender, double salary) {
		this.id = id;
		this.name = name;
		this.age = age;
		this.gender = gender;
		this.salary = salary;
	}
	
	public String getName() {
		// this代表当前new出来的对象
		// return this.name;
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public double getSalary() {
		return salary;
	}

	public void setSalary(double salary) {
		this.salary = salary;
	}

	@Override
	public String toString() {
		return "Student [id=" + id + ", name=" + name + ", age=" + age + ", gender=" + gender + ", salary=" + salary
				+ "]";
	}
	
	
}
